<template>
	<view class="content">
		<navbar title='律小狮学习中心' :isback="false">
		</navbar>
		<view class="xueone">
			<u-swiper :list="swlist" height="300" border-radius="10" indicatorMode="dot"></u-swiper>
		</view>
		<view class="klist">
			<view class="kitem one" @click="navClick(1)">
				<text class="kname">看题模式</text>
				<view class="kanti">
					<text class="dkai">点击开始</text>
				</view>
				<image class="kicon" src="@/static/new/kone.png"></image>
			</view>
			<view class="kitem two" @click="navClick(2)">
				<text class="kname">答题模式</text>
				<view class="kanti">
					<text class="dkai">点击开始</text>
				</view>
				<image class="kicon" src="@/static/new/ktwo.png"></image>
			</view>
			<!-- <view class="kitem three" @click="navClick(3)">
				<text class="kname">模拟考试</text>
				<view class="kanti">
					<text class="dkai">点击开始</text>
				</view>
				<image class="kicon" src="@/static/new/kthree.png"></image>
			</view> -->
			<view class="kitem four" @click="navClick(4)">
				<text class="kname">我的收藏</text>
				<view class="kanti">
					<text class="dkai">点击开始</text>
				</view>
				<image class="kicon" src="@/static/new/kfour.png"></image>
			</view>
			<view class="kitem five" @click="navClick(5)">
				<text class="kname">我的错题</text>
				<view class="kanti">
					<text class="dkai">点击开始</text>
				</view>
				<image class="kicon" src="@/static/new/kfive.png"></image>
			</view>
			<view class="kitem six" @click="navClick(6)">
				<text class="kname">题目搜索</text>
				<view class="kanti">
					<text class="dkai">点击开始</text>
				</view>
				<image class="kicon" src="@/static/new/ksix.png"></image>
			</view>
			<view class="kitem seven" @click="navClick(7)">
				<text class="kname">考试报名</text>
				<view class="kanti">
					<text class="dkai">点击开始</text>
				</view>
				<image class="kicon" src="@/static/new/kseven.png"></image>
			</view>
			<view class="kitem eight" @click="navClick(8)">
				<text class="kname">报名记录</text>
				<view class="kanti">
					<text class="dkai">点击开始</text>
				</view>
				<image class="kicon" src="@/static/new/keight.png"></image>
			</view>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				list:[],
				swlist:[
				// 'https://cdn.uviewui.com/uview/swiper/swiper1.png',
				// 'https://cdn.uviewui.com/uview/swiper/swiper2.png',
				// 'https://cdn.uviewui.com/uview/swiper/swiper3.png',
				]
			}
		},
		onLoad() {
			this.lun();
		},
		onShow() {
		},
		methods: {
			async lun(){
				let res = await this.$u.api.lunindex({
				});
				let shuzu = res.rotation
				let data = []
				for(let i in shuzu){
					data[i] = shuzu[i].img
				}
				this.swlist = data
			},
			navClick(e){
				if(e == 1){
					//看题模式
					this.navrouter(`/pages/StudPage/Papers`);
				}else if(e == 2){
					//试题试卷
					this.navrouter(`/pages/StudPage/TiMode`);
					
				}else if(e == 3){
					//考试试卷
					this.navrouter(`/pages/StudPage/Exampaper`);
				}else if(e == 4){
					//我的收藏
					this.navrouter(`/pages/StudPage/TimuCollect`);
				}else if(e == 5){
					//我的错题
					this.navrouter(`/pages/StudPage/TimuCuo`);
				}else if(e == 6){
					//题目搜索
					this.navrouter(`/pages/StudPage/TiSearch`);
				}else if(e == 7){
					//考试报名
					this.navrouter("/pages/TPage/BaoKaochang");
				}else if(e == 8){
					//报名记录
					this.navrouter("/pages/TPage/BaoRecord");
				}
			}
		}
	}
</script>
<style scoped lang="scss">
	.content {
		min-height: 100vh;
		background-color: #fff;
		padding: 30rpx;
		padding-bottom: 120rpx;
		.klist{
			display: flex;
			flex-direction: row;
			flex-wrap: wrap;
			margin: 30rpx 0;
			.kitem{
				margin-bottom: 24rpx;
				width: 48%;
				display: flex;
				flex-direction: column;
				padding: 30rpx 0;
				position: relative;
				border-radius: 20rpx;
				.kname{
					font-family: PingFang SC;
					font-weight: 800;
					font-size: 32rpx;
					// color: #3C66DE;
					display: inline-block;
					margin: 0rpx 0 0 30rpx;
				}
				.kanti{
					width: 130rpx;
					height: 36rpx;
					border-radius: 18rpx;
					border: 1rpx solid #3E65E5;
					display: flex;
					align-items: center;
					justify-content: center;
					margin-top: 20rpx;
					margin-left: 30rpx;
					.dkai{
						font-family: PingFang SC;
						font-weight: 400;
						font-size: 20rpx;
						// 
					}
				}
				.kicon{
					position: absolute;
					right: 10rpx;
					bottom: 0;
					width: 100rpx;
					height: 100rpx;
				}
			}
			.one{
				color: #3C66DE;
				background: #E2F1FF;
				.kname{
					color: #3C66DE;
				}
			}
			.two{
				background: #E2FFF9;
				color: #1F9980;
				.kanti{
					border: 1rpx solid #1F9980;
				}
			}
			.three{
				background: #FFEEE2;
				color:  #F4842A;
				.kanti{
					border: 1rpx solid #F4842A;
				}
			}
			.four{
				background: #E8E2FF;
				color:  #5137B2;
				.kanti{
					border: 1rpx solid #5137B2;
				}
			}
			.five{
				background: #E2F1FF;
				color:  #3C66DE;
				.kanti{
					border: 1rpx solid #3C66DE;
				}
			}
			.six{
				background: #E2FFF9;
				color:  #1F9980;
				.kanti{
					border: 1rpx solid #1F9980;
				}
			}
			.seven{
				background: #FFEEE2;
				color:  #F4842A;
				.kanti{
					border: 1rpx solid #F4842A;
				}
			}
			.eight{
				background: #E8E2FF;
				color:  #5137B2;
				.kanti{
					border: 1rpx solid #5137B2;
				}
			}
			.kitem:nth-child(even){
				margin-left: auto;
			}

			
		}
	}
</style>